<!DOCTYPE html><html lang="zh-CN" data-theme="light"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"><title>markdown新活 | XY Blog</title><meta name="keywords" content="技术"><meta name="author" content="XY"><meta name="copyright" content="XY"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="#ffffff"><meta name="description" content="一些markdown的新东西">
<meta property="og:type" content="article">
<meta property="og:title" content="markdown新活">
<meta property="og:url" content="http://example.com/2022/06/28/markdown_%E6%96%B0%E6%B4%BB/index.html">
<meta property="og:site_name" content="XY Blog">
<meta property="og:description" content="一些markdown的新东西">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="http://example.com/img/markdown.webp">
<meta property="article:published_time" content="2022-06-28T14:46:00.000Z">
<meta property="article:modified_time" content="2023-03-29T15:27:03.259Z">
<meta property="article:author" content="XY">
<meta property="article:tag" content="markdown">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="http://example.com/img/markdown.webp"><link rel="shortcut icon" href="/img/liuxing.jpg"><link rel="canonical" href="http://example.com/2022/06/28/markdown_%E6%96%B0%E6%B4%BB/"><link rel="preconnect" href="//cdn.jsdelivr.net"/><link rel="stylesheet" href="/css/index.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free/css/all.min.css" media="print" onload="this.media='all'"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox.min.css" media="print" onload="this.media='all'"><script>const GLOBAL_CONFIG = { 
  root: '/',
  algolia: undefined,
  localSearch: undefined,
  translate: {"defaultEncoding":2,"translateDelay":0,"msgToTraditionalChinese":"简","msgToSimplifiedChinese":"簡"},
  noticeOutdate: undefined,
  highlight: {"plugin":"highlighjs","highlightCopy":true,"highlightLang":true,"highlightHeightLimit":false},
  copy: {
    success: '复制成功',
    error: '复制错误',
    noSupport: '浏览器不支持'
  },
  relativeDate: {
    homepage: false,
    post: false
  },
  runtime: '',
  date_suffix: {
    just: '刚刚',
    min: '分钟前',
    hour: '小时前',
    day: '天前',
    month: '个月前'
  },
  copyright: undefined,
  lightbox: 'fancybox',
  Snackbar: undefined,
  source: {
    justifiedGallery: {
      js: 'https://cdn.jsdelivr.net/npm/flickr-justified-gallery/dist/fjGallery.min.js',
      css: 'https://cdn.jsdelivr.net/npm/flickr-justified-gallery/dist/fjGallery.min.css'
    }
  },
  isPhotoFigcaption: false,
  islazyload: false,
  isAnchor: false
}</script><script id="config-diff">var GLOBAL_CONFIG_SITE = {
  title: 'markdown新活',
  isPost: true,
  isHome: false,
  isHighlightShrink: false,
  isToc: true,
  postUpdate: '2023-03-29 23:27:03'
}</script><noscript><style type="text/css">
  #nav {
    opacity: 1
  }
  .justified-gallery img {
    opacity: 1
  }

  #recent-posts time,
  #post-meta time {
    display: inline !important
  }
</style></noscript><script>(win=>{
    win.saveToLocal = {
      set: function setWithExpiry(key, value, ttl) {
        if (ttl === 0) return
        const now = new Date()
        const expiryDay = ttl * 86400000
        const item = {
          value: value,
          expiry: now.getTime() + expiryDay,
        }
        localStorage.setItem(key, JSON.stringify(item))
      },

      get: function getWithExpiry(key) {
        const itemStr = localStorage.getItem(key)

        if (!itemStr) {
          return undefined
        }
        const item = JSON.parse(itemStr)
        const now = new Date()

        if (now.getTime() > item.expiry) {
          localStorage.removeItem(key)
          return undefined
        }
        return item.value
      }
    }
  
    win.getScript = url => new Promise((resolve, reject) => {
      const script = document.createElement('script')
      script.src = url
      script.async = true
      script.onerror = reject
      script.onload = script.onreadystatechange = function() {
        const loadState = this.readyState
        if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
        script.onload = script.onreadystatechange = null
        resolve()
      }
      document.head.appendChild(script)
    })
  
      win.activateDarkMode = function () {
        document.documentElement.setAttribute('data-theme', 'dark')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d')
        }
      }
      win.activateLightMode = function () {
        document.documentElement.setAttribute('data-theme', 'light')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#ffffff')
        }
      }
      const t = saveToLocal.get('theme')
    
          const now = new Date()
          const hour = now.getHours()
          const isNight = hour <= 6 || hour >= 18
          if (t === undefined) isNight ? activateDarkMode() : activateLightMode()
          else if (t === 'light') activateLightMode()
          else activateDarkMode()
        
      const asideStatus = saveToLocal.get('aside-status')
      if (asideStatus !== undefined) {
        if (asideStatus === 'hide') {
          document.documentElement.classList.add('hide-aside')
        } else {
          document.documentElement.classList.remove('hide-aside')
        }
      }
    
    const detectApple = () => {
      if(/iPad|iPhone|iPod|Macintosh/.test(navigator.userAgent)){
        document.documentElement.classList.add('apple')
      }
    }
    detectApple()
    })(window)</script><meta name="generator" content="Hexo 6.2.0"></head><body><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="avatar-img is-center"><img src="/img/liuxing.jpg" onerror="onerror=null;src='/img/friend_404.gif'" alt="avatar"/></div><div class="sidebar-site-data site-data is-center"><a href="/archives/"><div class="headline">文章</div><div class="length-num">9</div></a><a href="/tags/"><div class="headline">标签</div><div class="length-num">5</div></a><a href="/categories/"><div class="headline">分类</div><div class="length-num">1</div></a></div><hr/><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> 首页</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> 时间轴</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> 标籤</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw fas fa-link"></i><span> 友链</span></a></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw fas fa-heart"></i><span> 关于</span></a></div></div></div></div><div class="post" id="body-wrap"><header class="not-top-img" id="page-header"><nav id="nav"><span id="blog_name"><a id="site-name" href="/">XY Blog</a></span><div id="menus"><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> 首页</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> 时间轴</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> 标籤</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw fas fa-link"></i><span> 友链</span></a></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw fas fa-heart"></i><span> 关于</span></a></div></div><div id="toggle-menu"><a class="site-page"><i class="fas fa-bars fa-fw"></i></a></div></div></nav></header><main class="layout" id="content-inner"><div id="post"><div id="post-info"><h1 class="post-title">markdown新活</h1><div id="post-meta"><div class="meta-firstline"><span class="post-meta-date"><i class="far fa-calendar-alt fa-fw post-meta-icon"></i><span class="post-meta-label">发表于</span><time class="post-meta-date-created" datetime="2022-06-28T14:46:00.000Z" title="发表于 2022-06-28 22:46:00">2022-06-28</time><span class="post-meta-separator">|</span><i class="fas fa-history fa-fw post-meta-icon"></i><span class="post-meta-label">更新于</span><time class="post-meta-date-updated" datetime="2023-03-29T15:27:03.259Z" title="更新于 2023-03-29 23:27:03">2023-03-29</time></span><span class="post-meta-categories"><span class="post-meta-separator">|</span><i class="fas fa-inbox fa-fw post-meta-icon"></i><a class="post-meta-categories" href="/categories/%E6%8A%80%E6%9C%AF/">技术</a></span></div><div class="meta-secondline"></div></div></div><article class="post-content" id="article-container"><blockquote>
<p>近日刚刚考完，正好有空整理下这学期学到的mermaid和flowchart写法</p>
<h4 id="mermaid"><a href="#mermaid" class="headerlink" title="mermaid"></a>mermaid</h4><h5 id="流程图"><a href="#流程图" class="headerlink" title="流程图"></a>流程图</h5><figure class="highlight plaintext"><table><tr><td class="code"><pre><span class="line">(mermaid)</span><br><span class="line">graph LR;</span><br><span class="line">A[aa bb]--&gt;B(wo);</span><br><span class="line">A--&gt;C((我是C));</span><br><span class="line">B--&gt;D&gt;我是D];</span><br><span class="line">C--&gt;D;</span><br><span class="line">D--&gt;E&#123;我是E&#125;;</span><br><span class="line">C--&gt;E;</span><br><span class="line">2--&gt;E;</span><br><span class="line">_--&gt;E;</span><br></pre></td></tr></table></figure>
<figure class="highlight plaintext"><table><tr><td class="code"><pre><span class="line">graph LR;</span><br><span class="line">A[aa bb]--&gt;B(wo);</span><br><span class="line">A--&gt;C((我是C));</span><br><span class="line">B--&gt;D&gt;我是D];</span><br><span class="line">C--&gt;D;</span><br><span class="line">D--&gt;E&#123;我是E&#125;;</span><br><span class="line">C--&gt;E;</span><br><span class="line">2--&gt;E;</span><br><span class="line">_--&gt;E;</span><br></pre></td></tr></table></figure>
<ul>
<li>第一行指明方向  <figure class="highlight plaintext"><figcaption><span>- top bottom</span></figcaption><table><tr><td class="code"><pre><span class="line">BT - bottom top</span><br><span class="line">RL - right left</span><br><span class="line">LR - left right</span><br><span class="line">TD - same as TB</span><br></pre></td></tr></table></figure></li>
<li>节点默认只显示标识,但也可以通过如下方法控制其显示  <figure class="highlight plaintext"><table><tr><td class="code"><pre><span class="line">A[aa bb] 显示字符串aa bb的方框</span><br><span class="line">B(wo) 显示字符串wo的圆角框</span><br><span class="line">C((我是C)) 显示我是C字符串的圆圈</span><br><span class="line">D&gt;我是D] 显示我是D的半方框</span><br><span class="line">E&#123;我是E&#125; 显示我是E的正方形框</span><br></pre></td></tr></table></figure></li>
<li>连线可以选择如下形式  <figure class="highlight plaintext"><table><tr><td class="code"><pre><span class="line">A--&gt;B 箭头</span><br><span class="line">A--B 无箭头线</span><br><span class="line">A--hh dd--B或者A--|hh dd|B 线之间可以添加注释</span><br><span class="line">A-.-&gt;B 虚线箭头</span><br><span class="line">A-. hh .-&gt;B 添加了注释的虚线箭头</span><br><span class="line">A==&gt;B 加粗的箭头</span><br><span class="line">A== hh ==&gt;B 加注释加粗的箭头</span><br></pre></td></tr></table></figure>
<h5 id="饼图"><a href="#饼图" class="headerlink" title="饼图"></a>饼图</h5><figure class="highlight plaintext"><table><tr><td class="code"><pre><span class="line">pie</span><br><span class="line">title 数学成绩图</span><br><span class="line">&quot;90分以上&quot; : 15</span><br><span class="line">&quot;80-90分&quot; : 21</span><br><span class="line">&quot;70-80分&quot; : 12</span><br><span class="line">&quot;60-70分&quot; : 8</span><br><span class="line">&quot;60分以下&quot; : 5</span><br></pre></td></tr></table></figure>
<figure class="highlight plaintext"><table><tr><td class="code"><pre><span class="line">pie</span><br><span class="line">title 数学成绩图</span><br><span class="line">&quot;90分以上&quot; : 15</span><br><span class="line">&quot;80-90分&quot; : 21</span><br><span class="line">&quot;70-80分&quot; : 12</span><br><span class="line">&quot;60-70分&quot; : 8</span><br><span class="line">&quot;60分以下&quot; : 5</span><br></pre></td></tr></table></figure>
<h4 id="flowchart"><a href="#flowchart" class="headerlink" title="flowchart"></a>flowchart</h4><h5 id="语法"><a href="#语法" class="headerlink" title="语法"></a>语法</h5><h6 id="节点定义"><a href="#节点定义" class="headerlink" title="节点定义"></a>节点定义</h6>tag=&gt;type: content:&gt;url</li>
<li><code>:&gt;</code>表示给元素添加超链接</li>
<li>ag就是元素名字，type是这个元素的类型，有6中类型，分别为：<br>  元素说明： <ul>
<li>开始（椭圆形）：start</li>
<li>结束（椭圆形）：end</li>
<li>操作（矩形）：operation</li>
<li>多输出操作（矩形）：parallel</li>
<li>条件判断（菱形）：condition</li>
<li>输入输出（平行四边形）：inputoutput</li>
<li>预处理/子程序（圣旨形）：subroutine</li>
<li>content就是在框框中要写的内容，注意type后的冒号与文本之间一定要有个空格</li>
</ul>
</li>
<li>关键字<ul>
<li>yes/true：condition类型变量连接时，用于分别表示yes条件的流向</li>
<li>no/false：同上，表示否定条件的流向</li>
<li>left/right：表示连线出口在节点位置（默认下面是出口），可以跟- condition变量一起用：cond(yes,right)</li>
<li>path1/path2/path3：parallel变量的三个出口路径（默认下面是出口）</li>
</ul>
</li>
<li>状态<br>为节点设置不同的状态，可以通过不同的颜色显示，其中状态包括下面6个，含义如英文所示：<ul>
<li>past</li>
<li>current</li>
<li>future</li>
<li>approved</li>
<li>rejected</li>
<li>invalid<h6 id="节点连线"><a href="#节点连线" class="headerlink" title="节点连线"></a>节点连线</h6>变量名1-&gt;变量名2-&gt;…-&gt;变量名n<h6 id="连线状态"><a href="#连线状态" class="headerlink" title="连线状态"></a>连线状态</h6>变量名m@&gt;变量名n({“key”:”value”})<h5 id="实例"><a href="#实例" class="headerlink" title="实例"></a>实例</h5><figure class="highlight plaintext"><table><tr><td class="code"><pre><span class="line">   (flow)</span><br><span class="line">st=&gt;start: 开始</span><br><span class="line">e=&gt;end: 结束</span><br><span class="line">op1=&gt;operation: 操作1 | past</span><br><span class="line">op2=&gt;operation: 操作2 | current</span><br><span class="line">op3=&gt;operation: 操作3 | future</span><br><span class="line">pa=&gt;parallel: 多输出操作4 | approved</span><br><span class="line">cond=&gt;condition: 确认？ | rejected</span><br><span class="line"></span><br><span class="line">st-&gt;op1-&gt;cond</span><br><span class="line">cond(true)-&gt;e	</span><br><span class="line">cond(no)-&gt;op2(right)-&gt;op3-&gt;pa(path1,right)-&gt;op1</span><br><span class="line">pa(path2,left) -&gt;e</span><br><span class="line">st@&gt;op1(&#123;&quot;stroke&quot;:&quot;Blue&quot;&#125;)@&gt;cond(&#123;&quot;stroke&quot;:&quot;Green&quot;&#125;)@&gt;e(&#123;&quot;stroke&quot;:&quot;Red&quot;,&quot;stroke-width&quot;:6,&quot;arrow-end&quot;:&quot;classic-wide-long&quot;&#125;)</span><br></pre></td></tr></table></figure>
<img src="http://img.sc-xy.top/img/md_view2.png" alt><br>这些东西提升了markdownd的可玩性，让markdown有了更多的受众，也方便了我们的生活。但是，mrakdown肯定还有更多的好东西等着我们去探索。</li>
</ul>
</li>
</ul>
<p>最近总算是把事情都忙完了，自己的时间渐渐多了起来，暑假就用来准备数学建模竞赛和大创吧，也算是有了个长期稳定的队友，让我们一起冲冲冲！！！</p>
</blockquote>
</article><div class="tag_share"><div class="post-meta__tag-list"><a class="post-meta__tags" href="/tags/markdown/">markdown</a></div><div class="post_share"><div class="social-share" data-image="/img/markdown.webp" data-sites="facebook,twitter,wechat,weibo,qq"></div><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/butterfly-extsrc/sharejs/dist/css/share.min.css" media="print" onload="this.media='all'"><script src="https://cdn.jsdelivr.net/npm/butterfly-extsrc/sharejs/dist/js/social-share.min.js" defer></script></div></div><nav class="pagination-post" id="pagination"><div class="prev-post pull-left"><a href="/2022/06/29/%E7%99%BD%E5%AB%96%E5%9B%BE%E5%BA%8A/"><img class="prev-cover" src="/img/github.jfif" onerror="onerror=null;src='/img/404.jpg'" alt="cover of previous post"><div class="pagination-info"><div class="label">上一篇</div><div class="prev_info">在GitHub白嫖图床</div></div></a></div><div class="next-post pull-right"><a href="/2022/06/26/git_try/"><img class="next-cover" src="/img/git.webp" onerror="onerror=null;src='/img/404.jpg'" alt="cover of next post"><div class="pagination-info"><div class="label">下一篇</div><div class="next_info">Git Try</div></div></a></div></nav></div><div class="aside-content" id="aside-content"><div class="sticky_layout"><div class="card-widget" id="card-toc"><div class="item-headline"><i class="fas fa-stream"></i><span>目录</span><span class="toc-percentage"></span></div><div class="toc-content"><ol class="toc"><li class="toc-item toc-level-4"><a class="toc-link" href="#mermaid"><span class="toc-number">1.</span> <span class="toc-text">mermaid</span></a><ol class="toc-child"><li class="toc-item toc-level-5"><a class="toc-link" href="#%E6%B5%81%E7%A8%8B%E5%9B%BE"><span class="toc-number">1.1.</span> <span class="toc-text">流程图</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#%E9%A5%BC%E5%9B%BE"><span class="toc-number">1.2.</span> <span class="toc-text">饼图</span></a></li></ol></li><li class="toc-item toc-level-4"><a class="toc-link" href="#flowchart"><span class="toc-number">2.</span> <span class="toc-text">flowchart</span></a><ol class="toc-child"><li class="toc-item toc-level-5"><a class="toc-link" href="#%E8%AF%AD%E6%B3%95"><span class="toc-number">2.1.</span> <span class="toc-text">语法</span></a><ol class="toc-child"><li class="toc-item toc-level-6"><a class="toc-link" href="#%E8%8A%82%E7%82%B9%E5%AE%9A%E4%B9%89"><span class="toc-number">2.1.1.</span> <span class="toc-text">节点定义</span></a></li><li class="toc-item toc-level-6"><a class="toc-link" href="#%E8%8A%82%E7%82%B9%E8%BF%9E%E7%BA%BF"><span class="toc-number">2.1.2.</span> <span class="toc-text">节点连线</span></a></li><li class="toc-item toc-level-6"><a class="toc-link" href="#%E8%BF%9E%E7%BA%BF%E7%8A%B6%E6%80%81"><span class="toc-number">2.1.3.</span> <span class="toc-text">连线状态</span></a></li></ol></li><li class="toc-item toc-level-5"><a class="toc-link" href="#%E5%AE%9E%E4%BE%8B"><span class="toc-number">2.2.</span> <span class="toc-text">实例</span></a></li></ol></li></ol></div></div></div></div></main><footer id="footer"><div id="footer-wrap"><div class="copyright">&copy;2022 - 2023 By XY</div><div class="framework-info"><span>框架 </span><a target="_blank" rel="noopener" href="https://hexo.io">Hexo</a><span class="footer-separator">|</span><span>主题 </span><a target="_blank" rel="noopener" href="https://github.com/jerryc127/hexo-theme-butterfly">Butterfly</a></div><div class="footer_custom_text">Hi, welcome to my blog! <a target="_blank" rel="noopener" href="https://beian.miit.gov.cn"><img class="icp-icon" src="https://img.alicdn.com/tfs/TB1..50QpXXXXX7XpXXXXXXXXXX-40-40.png"><span>蜀ICP备2022030939号</span></a> <a href="https://icp.gov.moe/?keyword=20220702" target="_blank">萌ICP备20220702号</a></div></div></footer></div><div id="rightside"><div id="rightside-config-hide"><button id="readmode" type="button" title="阅读模式"><i class="fas fa-book-open"></i></button><button id="translateLink" type="button" title="简繁转换">简</button><button id="darkmode" type="button" title="浅色和深色模式转换"><i class="fas fa-adjust"></i></button><button id="hide-aside-btn" type="button" title="单栏和双栏切换"><i class="fas fa-arrows-alt-h"></i></button></div><div id="rightside-config-show"><button id="rightside_config" type="button" title="设置"><i class="fas fa-cog fa-spin"></i></button><button class="close" id="mobile-toc-button" type="button" title="目录"><i class="fas fa-list-ul"></i></button><button id="go-up" type="button" title="回到顶部"><i class="fas fa-arrow-up"></i></button></div></div><div><script src="/js/utils.js"></script><script src="/js/main.js"></script><script src="/js/tw_cn.js"></script><script src="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox.umd.min.js"></script><script src="https://cdn.jsdelivr.net/npm/instant.page/instantpage.min.js" type="module"></script><div class="js-pjax"><script>(() => {
  const $mermaidWrap = document.querySelectorAll('#article-container .mermaid-wrap')
  if ($mermaidWrap.length) {
    window.runMermaid = () => {
      window.loadMermaid = true
      const theme = document.documentElement.getAttribute('data-theme') === 'dark' ? 'dark' : 'default'

      Array.from($mermaidWrap).forEach((item, index) => {
        const mermaidSrc = item.firstElementChild
        const mermaidThemeConfig = '%%{init:{ \'theme\':\'' + theme + '\'}}%%\n'
        const mermaidID = 'mermaid-' + index
        const mermaidDefinition = mermaidThemeConfig + mermaidSrc.textContent
        mermaid.mermaidAPI.render(mermaidID, mermaidDefinition, (svgCode) => {
          mermaidSrc.insertAdjacentHTML('afterend', svgCode)
        })
      })
    }

    const loadMermaid = () => {
      window.loadMermaid ? runMermaid() : getScript('https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js').then(runMermaid)
    }

    window.pjax ? loadMermaid() : document.addEventListener('DOMContentLoaded', loadMermaid)
  }
})()</script></div><script defer="defer" id="ribbon" src="https://cdn.jsdelivr.net/npm/butterfly-extsrc/dist/canvas-ribbon.min.js" size="150" alpha="0.6" zIndex="-1" mobile="true" data-click="true"></script></div></body></html>